package com.qq.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName MySelfRule
 * @Description TODO
 * Author yangqinglin
 * @Date 2020/7/21 14:49
 * @Version
 **/

@Configuration
public class MySelfRule {

    @Bean
//返回随机类型服务
    //必须写在springcloud 防止@compentScan
    public IRule myRule(){
        return  new RandomRule();
    }
}
